package com.baizhi.service.impl;

import com.baizhi.entity.Comment;
import com.baizhi.mapper.CommentMapper;
import com.baizhi.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;
    @Override
    public Comment selectComment(Integer cid) {
        return commentMapper.selectComment(cid);
    }

    @Override
    public void insertComment(Comment comment) {
        commentMapper.insertComment(comment);
    }

    @Override
    public void deleteComment(Integer cId, Integer uId) {
        commentMapper.deleteByCId(cId,uId);
    }
}
